package com.feiyun.util;

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Date;

/**
 * @ClassName DateUtils
 * @author: xingming
 * @Description:
 * @time 2023/04/02 14:27:07
 * @Version 1.0
 */
public class LocalDateUtils {

    /**
     * 获取当前时间
     *
     * @return
     */
    public static LocalDateTime getNowDate() {
        Date date = new Date();
        Instant instant = date.toInstant();
        ZoneId zoneId = ZoneId.systemDefault();
        ZonedDateTime zonedDateTime = instant.atZone(zoneId);
        return zonedDateTime.toLocalDateTime();
    }
}
